<?php

    namespace PHPK;

    use PDO;

    class Database {

	/**
	 * Array containing database attributes
	 * @var array $_arDb
	 */
	private $_arDb = array();

	/**
	 * Constructor to create a Database object
	 * @method __construct
	 * @param string $strDBFile Name of the database file
	 */
	public function __construct( $strDBFile ) {

	    $this->_arDb[ 'dsn' ] = 'sqlite:' . $strDBFile;
	    $this->_arDb[ 'pdo' ] = new PDO( $this->_arDb[ 'dsn' ] );

	}

	/**
	 * Magic method to get Database properties
	 * @method __get
	 * @param string $strKey Key identifying the attribute
	 * @returns mixed The attribute as identified by the key
	 */
	public function __get( $strKey ) {

	    if ( isset( $this->_arDb[ $strKey ] ) )
		return $this->_arDb[ $strKey ];

	    return false;

	}

    }

?>
